<cfinclude template="/ecada/header.cfm">

	<cfquery datasource="exp" name="experiments">
    	SELECT *
		FROM experiment 
		WHERE id=#id#
    </cfquery>
    
    <cfquery datasource="exp" name="numparticipants">
    	SELECT count(id) as cnt 
		FROM participant
		WHERE expid=#id#
    </cfquery>
	
    <cfquery datasource="exp" name="conditions">
    	SELECT count(id) as cnt 
		FROM conditions
		WHERE expid=#id#
    </cfquery>
<cfoutput>
	<table border="1">
		<tr>
			<th colspan=2>Experiment Details</th>
		</tr>
		<tr>
			<td colspan=2>Title: #experiments.title#</td>
		</tr>
		<tr>
			<td colspan=2>#experiments.description#</td>
		</tr>
		<tr>
			<td >Maximum participants: </td>
			<td>#experiments.maxpart#</td>
		</tr>
		<tr>
			<td>Number of Participants: </td>
			<td>#numparticipants.cnt#</td>
		</tr>
		<tr>
			<td>start date: </td>
			<td>#experiments.startDate#</td>
		</tr>
		<tr>
			<td>end date: </td>
			<td>#experiments.endDate#</td>
		</tr>
		<tr>
			<td>Number of Conditions: </td>
			<td>#conditions.cnt#</td>
		</tr>
		<tr>
			<td colspan=2>
				<cfif numparticipants.cnt gt 0>
					<form method="post" action="/ecada/analyse/graphsbytrial.cfm">
						<input type = "hidden" name="id" value="#id#">
						<input type = "submit" value="Graphs by Trial">
					</form>

					<form method="post" action="/ecada/analyse/chartsbycondition.cfm">
						<input type = "hidden" name="expid" value="#id#">
						<input type = "submit" value="Graphs by Condition">
					</form>

					<form method="post" action="/ecada/analyse/genxls.cfm">
						<input type = "hidden" name="expid" value="#id#">
						<input type = "submit" value="Export data as XML">
					</form>
					<form method="post" action="/ecada/analyse/gencsv.cfm">
						<input type = "hidden" name="expid" value="#id#">
						<input type = "submit" value="Export data as CSV">
					</form>
				<cfelse>
					No Actions Available
				</cfif>
			</td>
		</tr>
	</table>
</cfoutput>
<cfinclude template="/ecada/footer.cfm">

